<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        .box{width:200px;height:200px;background: red;}
    </style>
</head>
<body>
    <div class="box"></div>
</body>
<script>
    var box = document.querySelector(".box")
    box.onclick = function(eve){
        // 获取事件对象
        var e = eve || window.event;
        
        console.log(e);
    }
</script>
</html>